All Questions
16 questions
3votes
0answers
395views
Setting preference summary
I'm taking and Android course and I would like to refactor the code for one of the exercises. The complete solution done by tutors is here. When I was doing this exercise by myself I was annoyed by ...
2votes
0answers
171views
Implementing FusedLocationProvider for more than one Activity in Android
I am trying to implement Google Maps in Android. I am also trying to learn different design patterns. I want to use location in more than one Activity hence I have used a class named 'GoogleLocation' ...
3votes
1answer
3kviews
Base activity for handling network state changes in Android
I had the need in one of my activies to handle displaying a message to the user when the network disconnected, and then reload the data for a RecyclerView adapter ...
4votes
1answer
47views
Places and their PlaceCategories
I'm going to start small here because I actually have several questions but I'll go one at a time. In the app I am making to better learn Java/Android/SQL/OOP, I have a page where a user can define ...
1vote
2answers
715views
Properly structuring SQLite classes/operations in Android
I am new to Android development and I want to ensure I'm learning decent practices for doing things. Right now this is my database class, which currently allows me to make a new instance of the ...
1vote
0answers
2kviews
Repository pattern best practices
Which option is better? In the first case, I use a universal repository that can work with any entities. The methods of this repository have many parameters, such as string queries, table names, ...
5votes
0answers
14kviews
Using the same RecyclerView.Adapter with a different ViewHolder
I would use the same RecyclerView.Adapter with two or more different fragments. Every fragment uses a different view items layout so I must use a different ...
3votes
1answer
1kviews
Event Aggregator Pattern Decoupling
I have an Android application that is using an EventBus architecture with publishing and subscribing events. Usually this is ...
8votes
2answers
1kviews
Strategy Pattern Implementation
I thought I would learn a design pattern today and picked this one. I wrote a simple Android test demo to test the pattern. main.xml ...
7votes
1answer
297views
Android game setup
I've been working on a basic Android game these days, but I'm a bit uncertain about my setup and need some advice. The basics of the game are simple: there are characters running on your screen and ...
2votes
1answer
108views
Detaching logic from listener implementation in "Smart UI" approach to follow a proper pattern
I took this code segment from existing source on Android, but it applies to anything from ASP.NET Forms to anything else where the UI has an event callback, and the logic is implemented directly in ...
7votes
1answer
441views
Unit conversion activities
Please review these activities which handle converting units in an Android app: I would appreciate any guidance and advice on code refactoring and different design patterns or strategies that I ...
6votes
2answers
213views
Create and organize some classes (hierarchy)
I'm trying to figure out what is the best way to create some objects in my application. The application is already running, but I want to structure things well and clean. These objects represents ...
3votes
1answer
2kviews
TicTacToe - introduction to MVC pattern
After reading about MVC pattern in Head First Design Patterns, I've decided to write a TicTacToe app. I will not reveal the source code of the classes Matrix, <...
5votes
1answer
306views
First introduction to MVC
I'm not sure that I fully understand this pattern. I've written a simple application that uses MVC. Please criticize my approach to the use of this pattern. For convenience, I'll post the source code ...